package cn.tsoft
{
	import mx.rpc.AbstractOperation;
	import mx.rpc.AsyncToken;
	import mx.rpc.remoting.mxml.RemoteObject;

	public class RemoteObjectInvoker implements IInvoker
	{
		
		private var ro:RemoteObject ;
		public function RemoteObjectInvoker(dest:String)
		{
			ro= new RemoteObject(dest);
			ro.endpoint="messagebroker/amf";
		}

		public function invoker(method:String, ...args):IInvokeResponder
		{
			var oper:AbstractOperation = ro.getOperation(method);
			var token:AsyncToken = oper.send.apply(oper,args);
			return  new cn.tsoft.AsyncResponder(token);
		}
		
	}
}